#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main()
{
	char ch; int count = 0;
	ch = getchar();

	while (ch != '\n')
	{
		if (ch != ' ')
		{
			ch = getchar();
			if (ch == ' ' || ch == '\n')
				count++;
			continue;
		}
		else if (ch == ' ')
		{
			ch = getchar();
		}
	}
	printf("%d", count);
	return 0;
}
